﻿using System.Collections.Generic;
using Interfaces.Criteria;
using Interfaces.Filters;
using Interfaces.Models;
using Interfaces.Providers;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Unity;
using YQLDataProvider.Providers;

namespace YQLDataProvider
{
    public class YqlDataProviderModule : IModule
    {
        private readonly IUnityContainer _container;

        public YqlDataProviderModule(IUnityContainer container)
        {
            _container = container;
        }

        public void Initialize()
        {
            _container.RegisterType<ISettingsFactory,SettingsFactory>();
            _container.RegisterType
               <IEconomicDataProvider<IEnumerable<IIndustrySector>, ISectorsFilter, IBaseCriteria>,YqlIndustrySectorsDataProvider>();
            _container.RegisterType
                <IEconomicDataProvider<IEnumerable<IIndustry>, IIndustryFilter, IKeySupportedCriteria>, YqlIndustryDataProvider>();
            _container.RegisterType
                <IEconomicDataProvider<IEnumerable<IQuote>, IQuoteisFilter, IKeySupportedCriteria>, YqlQuoteDataProvider>();
            _container.RegisterType
                <IEconomicDataProvider<IEnumerable<IXchangeRate>, IXchangeRateFilter, IKeySupportedCriteria>,YqlXchangeRateDataProvider>();
        }
    }
}
